#include "Value.hpp"

String Value::nameForType(DataType type)
{
	switch(type)
	{
		case Value::Int:  return "int";
		case Value::Str:  return "str";
		case Value::Bool: return "bool";
		case Value::Real: return "real";
	}
	return "null";
}

Value::DataType Value::typeForName(String const & typeName)
{
	if(typeName == "int")
		return Value::Int;
	else if(typeName == "str")
		return Value::Str;
	else if(typeName == "bool")
		return Value::Bool;
	else if(typeName == "real")
		return Value::Real;
	else
		return Value::Null;
}
